<template>
  <i class="fa fa-fw" :class="strClass">
    <slot />
  </i>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue'

export default defineComponent({
  name: 'KIcon',
  props: {
    name: String,
    size: String
  },
  setup (props) {
    const strClass = ref()

    let str = `fa-${props.name}`
    if (props.size !== '') {
      str += ` fa-${props.size}`
    }
    strClass.value = str

    return {
      strClass
    }
  }
})
</script>

<style scoped>
</style>
